package com.javabean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * @Author: 张波
 * @Time: 2025/8/27 18:55
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Orders {
	private int id;
	private String orderNum;
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
	private Date orderTime;
	private int peopleCount;
	private String orderDesc;
	private int payType;//'支付方式（0 支付宝 1微信 2 其他',
	private int orderStatus;// '订单状态（0未支付1已支付）',
	private int productId;// '产品id外键',
	private int memberId;// '会员（联系人）id外键',
	private Member member;


	private Product product;
	private List<Traveller> travellers;
	public String getPayTypeStr() {
		String payTypeStr="";
		if (payType == 0){
			payTypeStr = "支付宝";
		} else if(payType == 1){
			payTypeStr = "微信";
		}else if(payType == 2){
			payTypeStr = "其他";
		}
		return payTypeStr;
	}

	public String getOrderStatusStr() {
		String orderStatusStr="";
		if (orderStatus == 0){
			orderStatusStr = "未支付";
		} else if(orderStatus == 1){
			orderStatusStr = "已支付";
		}
		return orderStatusStr;
	}
}
